/**
 * Copyright (c) 2007,中企动力华南研发中心<br>
 * All rights reserved.<br>
 */
package com.ce.pms.system.renovation.dao.impl;

import java.util.List;

import org.hibernate.Query;

import com.ce.pms.base.dao.impl.PmsBaseDaoImpl;
import com.ce.pms.base.vo.SearchVO;
import com.ce.pms.system.renovation.dao.ICheckConfirmItemConfigDao;
import com.ce.pms.system.renovation.model.CheckConfirmItemConfigDO;
import com.sitechasia.webx.core.support.Page;

/**
 * 功能描述进场确认项目<br>
 * @author 易贤建 创建日期：2008-12-31<br>
 */
public class CheckConfirmItemConfigDaoImpl extends PmsBaseDaoImpl<CheckConfirmItemConfigDO> implements
		ICheckConfirmItemConfigDao {
	/**
	 * 查询所有进场确认项目
	 */
	public Page queryAll(SearchVO searchVO) {
		String queryStr = " FROM CheckConfirmItemConfigDO WHERE 1=1 ";
		return super.pagedQueryByPageNo(queryStr, searchVO.getPageNo(), searchVO.getPageSize());
	}

	/**
	 * 查询所有可用的进场确认项目,不分页
	 */
	public List<CheckConfirmItemConfigDO> queryAll() {
		String queryStr = " FROM CheckConfirmItemConfigDO itemConfig WHERE itemConfig.state='001' ";
		Query query=createQuery(queryStr, null);
		return query.list();
	}

	/**
	 * 功能描述:查询所有名称一样的出入证收费项目<br>
	 * @param searchVO
	 * Create author:yixianjian <br>
	 * Create on:2008-12-31  <br>
	 */
	@SuppressWarnings("unchecked")
	public List<CheckConfirmItemConfigDO> findByItemName(String itemName){
		StringBuffer queryStr = new StringBuffer(" FROM CheckConfirmItemConfigDO confgiDO");
					queryStr.append(" WHERE 1=1  ");
					queryStr.append(" AND confgiDO.itemName=?");
		Query query = super.createQuery(queryStr.toString(), itemName);
		return query.list();
	}
	/**
	 * 功能描述:查询所有名称一样、KEYWORD不一样的出入证收费项目<br>
	 * @param searchVO
	 * Create author:yixianjian <br>
	 * Create on:2008-12-31  <br>
	 */
	@SuppressWarnings("unchecked")
	public List<CheckConfirmItemConfigDO> findByItemNameWithoutKeyword(Long keyword,String itemName){
		StringBuffer queryStr = new StringBuffer(" FROM CheckConfirmItemConfigDO configDO");
							queryStr.append(" WHERE 1=1  ");
							queryStr.append(" AND configDO.keyword!=?");
							queryStr.append(" AND configDO.itemName=?");
		Query query = super.createQuery(queryStr.toString() , keyword, itemName);
		return query.list();
	}
}
